home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / MySql / support-files / mysql-3.23.37.spec < prev    next >
Encoding:
Text File  |  2001-01-01  |  14.8 KB  |  464 lines

  1. %define mysql_version        3.23.37
  2. %define shared_lib_version    10:0:0
  3. %define release            1
  4. %define mysqld_user        mysql
  5.  
  6. %define see_base For a description of MySQL see the base MySQL RPM or http://www.mysql.com
  7.  
  8. Name: MySQL
  9. Summary:    MySQL: a very fast and reliable SQL database engine
  10. Group:        Applications/Databases
  11. Summary(pt_BR): MySQL: Um servidor SQL rápido e confiável.
  12. Group(pt_BR):    Aplicações/Banco_de_Dados
  13. Version:    3.23.37
  14. Release:    %{release}
  15. Copyright:    GPL / LGPL
  16. Source:        http://www.mysql.com/Downloads/MySQL-3.23/mysql-%{mysql_version}.tar.gz
  17. Icon:        mysql.gif
  18. URL:        http://www.mysql.com/
  19. Packager:    David Axmark <david@mysql.com>
  20. Vendor:        MySQL AB
  21. Provides:    msqlormysql MySQL-server
  22. Obsoletes:    mysql
  23.  
  24. # Think about what you use here since the first step is to
  25. # run a rm -rf
  26. BuildRoot:    /var/tmp/mysql
  27.  
  28. # From the manual
  29. %description
  30. MySQL is a true multi-user, multi-threaded SQL (Structured Query
  31. Language) database server. MySQL is a client/server implementation
  32. that consists of a server daemon (mysqld) and many different client
  33. programs/libraries.
  34.  
  35. The main goals of MySQL are speed, robustness and ease of use.  MySQL
  36. was originally developed because we needed a SQL server that could
  37. handle very big databases with magnitude higher speed than what any
  38. database vendor could offer to us. And since we did not need all the
  39. features that made their server slow we made our own. We have now been
  40. using MySQL since 1996 in a environment with more than 40 databases,
  41. 10,000 tables, of which more than 500 have more than 7 million
  42. rows. This is about 200G of data.
  43.  
  44. The base upon which MySQL is built is a set of routines that have been
  45. used in a highly demanding production environment for many
  46. years. While MySQL is still in development, it already offers a rich
  47. and highly useful function set.
  48.  
  49. See the documentation for more information.
  50.  
  51. %description -l pt_BR
  52. O MySQL é um servidor de banco de dados SQL realmente multiusuário e\
  53. multi-tarefa. A linguagem SQL é a mais popular linguagem para banco de\
  54. dados no mundo. O MySQL é uma implementação cliente/servidor que\
  55. consiste de um servidor chamado mysqld e diversos\
  56. programas/bibliotecas clientes. Os principais objetivos do MySQL são:\
  57. velocidade, robustez e facilidade de uso.  O MySQL foi originalmente\
  58. desenvolvido porque nós na Tcx precisávamos de um servidor SQL que\
  59. pudesse lidar com grandes bases de dados e com uma velocidade muito\
  60. maior do que a que qualquer vendedor podia nos oferecer. Estamos\
  61. usando\
  62. o MySQL desde 1996 em um ambiente com mais de 40 bases de dados com 10.000\
  63. tabelas, das quais mais de 500 têm mais de 7 milhões de linhas. Isto é o\
  64. equivalente a aproximadamente 50G de dados críticos. A base da construção do\
  65. MySQL é uma série de rotinas que foram usadas em um ambiente de produção com\
  66. alta demanda por muitos anos. Mesmo o MySQL estando ainda em desenvolvimento,\
  67. ele já oferece um conjunto de funções muito ricas e úteis. Veja a documentação\
  68. para maiores informações.
  69.  
  70. %package client
  71. Release: %{release}
  72. Summary: MySQL - Client
  73. Group: Applications/Databases
  74. Summary(pt_BR): MySQL - Cliente
  75. Group(pt_BR): Aplicações/Banco_de_Dados
  76. Obsoletes: mysql-client
  77.  
  78. %description client
  79. This package contains the standard MySQL clients. 
  80.  
  81. %{see_base}
  82.  
  83. %description client -l pt_BR
  84. Este pacote contém os clientes padrão para o MySQL.
  85.  
  86. %package bench
  87. Release: %{release}
  88. Requires: MySQL-client MySQL-DBI-perl-bin perl
  89. Summary: MySQL - Benchmarks and test system
  90. Group: Applications/Databases
  91. Summary(pt_BR): MySQL - Medições de desempenho
  92. Group(pt_BR): Aplicações/Banco_de_Dados
  93. Obsoletes: mysql-bench
  94.  
  95. %description bench
  96. This package contains MySQL benchmark scripts and data.
  97.  
  98. %{see_base}
  99.  
  100. %description bench -l pt_BR
  101. Este pacote contém medições de desempenho de scripts e dados do MySQL.
  102.  
  103. %package devel
  104. Release: %{release}
  105. Requires: MySQL-client
  106. Summary: MySQL - Development header files and libraries
  107. Group: Applications/Databases
  108. Summary(pt_BR): MySQL - Medições de desempenho
  109. Group(pt_BR): Aplicações/Banco_de_Dados
  110. Obsoletes: mysql-devel
  111.  
  112. %description devel
  113. This package contains the development header files and libraries
  114. necessary to develop MySQL client applications.
  115.  
  116. %{see_base}
  117.  
  118. %description devel -l pt_BR
  119. Este pacote contém os arquivos de cabeçalho (header files) e bibliotecas 
  120. necessárias para desenvolver aplicações clientes do MySQL. 
  121.  
  122. %package shared
  123. Release: %{release}
  124. Summary: MySQL - Shared libraries
  125. Group: Applications/Databases
  126.  
  127. %description shared
  128. This package contains the shared libraries (*.so*) which certain
  129. languages and applications need to dynamically load and use MySQL.
  130.  
  131. %package Max
  132. Release: %{release}
  133. Summary: MySQL - server with Berkeley DB and Innodb support
  134. Group: Applications/Databases
  135. Obsoletes: mysql-Max
  136.  
  137. %description Max 
  138. Optional MySQL server binary that supports features
  139. like transactional tables. To active this binary, just install this
  140. package after the MySQL package.
  141.  
  142. %prep
  143. %setup -n mysql-%{mysql_version}
  144.  
  145. %build
  146. # The all-static flag is to make the RPM work on different
  147. # distributions. This version tries to put shared mysqlclient libraries
  148. # in a separate package.
  149.  
  150. BuildMySQL() {
  151. # The --enable-assembler simply does nothing on systems that does not
  152. # support assembler speedups.
  153. sh -c  "PATH=\"${MYSQL_BUILD_PATH:-/bin:/usr/bin}\" \
  154.     CC=\"${MYSQL_BUILD_CC:-egcs}\" \
  155.     CFLAGS=\"${MYSQL_BUILD_CFLAGS:- -O3}\" \
  156.     CXX=\"${MYSQL_BUILD_CXX:-egcs}\" \
  157.     CXXFLAGS=\"${MYSQL_BUILD_CXXFLAGS:- -O3 \
  158.               -felide-constructors -fno-exceptions -fno-rtti \
  159.           }\" \
  160.     ./configure \
  161.          $* \
  162.         --enable-assembler \
  163.             --with-mysqld-user=%{mysqld_user} \
  164.             --with-unix-socket-path=/var/lib/mysql/mysql.sock \
  165.             --prefix=/ \
  166.         --with-extra-charsets=complex \
  167.             --exec-prefix=/usr \
  168.             --libexecdir=/usr/sbin \
  169.             --sysconfdir=/etc \
  170.             --datadir=/usr/share \
  171.             --localstatedir=/var/lib/mysql \
  172.             --infodir=/usr/info \
  173.             --includedir=/usr/include \
  174.             --mandir=/usr/man \
  175.         --with-comment=\"Official MySQL RPM\";
  176.         # Add this for more debugging support
  177.         # --with-debug
  178.         # Add this for MyISAM RAID support:
  179.         # --with-raid
  180.         "
  181.  
  182.  # benchdir does not fit in above model. Maybe a separate bench distribution
  183.  make benchdir_root=$RPM_BUILD_ROOT/usr/share/
  184. }
  185.  
  186. # Use the build root for temporary storage of the shared libraries.
  187.  
  188. RBR=$RPM_BUILD_ROOT
  189. MBD=$RPM_BUILD_DIR/mysql-%{mysql_version}
  190. if test -z "$RBR" -o "$RBR" = "/"
  191. then
  192.     echo "RPM_BUILD_ROOT has stupid value"
  193.     exit 1
  194. fi
  195. rm -rf $RBR
  196. mkdir -p $RBR
  197.  
  198. # Build the shared libraries and mysqld-max
  199.  
  200. BuildMySQL "--enable-shared --enable-thread-safe-client --with-berkeley-db --with-innodb --with-mysqld-ldflags='-all-static' --with-server-suffix='-Max'"
  201.  
  202. # Save everything for debug
  203. # tar cf $RBR/all.tar .
  204.  
  205. # Save shared libraries and mysqld-max
  206. mv sql/mysqld sql/mysqld-max
  207. (cd libmysql/.libs; tar cf $RBR/shared-libs.tar *.so*)
  208. (cd libmysql_r/.libs; tar rf $RBR/shared-libs.tar *.so*)
  209.  
  210. # Save manual to avoid rebuilding
  211. mv Docs/manual.ps Docs/manual.ps.save
  212. make distclean
  213. mv Docs/manual.ps.save Docs/manual.ps
  214.  
  215. # RPM:s destroys Makefile.in files, so we generate them here
  216. automake
  217.  
  218. BuildMySQL "--disable-shared" \
  219.        "--with-mysqld-ldflags='-all-static'" \
  220.        "--with-client-ldflags='-all-static'" \
  221.        "--without-berkeley-db --without-innodb"
  222.  
  223. %install -n mysql-%{mysql_version}
  224. RBR=$RPM_BUILD_ROOT
  225. MBD=$RPM_BUILD_DIR/mysql-%{mysql_version}
  226. # Ensure that needed directories exists
  227. install -d $RBR/etc/{logrotate.d,rc.d/init.d}
  228. install -d $RBR/var/lib/mysql/mysql
  229. install -d $RBR/usr/share/sql-bench
  230. install -d $RBR/usr/share/mysql-test
  231. install -d $RBR/usr/{sbin,share,man,include}
  232. install -d $RBR/usr/doc/MySQL-%{mysql_version}
  233. install -d $RBR/usr/lib
  234. # Make install
  235. make install DESTDIR=$RBR benchdir_root=/usr/share/
  236.  
  237. # Install shared libraries (Disable for architectures that don't support it)
  238. (cd $RBR/usr/lib; tar xf $RBR/shared-libs.tar)
  239.  
  240. # install saved mysqld-max
  241. install -m755 $MBD/sql/mysqld-max $RBR/usr/sbin/mysqld-max
  242.  
  243. # Install logrotate and autostart
  244. install -m644 $MBD/support-files/mysql-log-rotate $RBR/etc/logrotate.d/mysql
  245. install -m755 $MBD/support-files/mysql.server $RBR/etc/rc.d/init.d/mysql
  246.  
  247. # Install docs
  248. install -m644 $RPM_BUILD_DIR/mysql-%{mysql_version}/Docs/mysql.info \
  249.  $RBR/usr/info/mysql.info
  250. for file in README COPYING COPYING.LIB Docs/manual_toc.html Docs/manual.html \
  251.     Docs/manual.txt Docs/manual.texi Docs/manual.ps \
  252.     support-files/my-huge.cnf support-files/my-large.cnf \
  253.     support-files/my-medium.cnf support-files/my-small.cnf
  254. do
  255.     b=`basename $file`
  256.     install -m644 $MBD/$file $RBR/usr/doc/MySQL-%{mysql_version}/$b
  257. done
  258.  
  259. %pre
  260. if test -x /etc/rc.d/init.d/mysql
  261. then
  262.   /etc/rc.d/init.d/mysql stop > /dev/null 2>&1
  263.   echo "Giving mysqld a couple of seconds to exit nicely"
  264.   sleep 5
  265. fi
  266.  
  267. %post
  268. mysql_datadir=/var/lib/mysql
  269.  
  270. # Create data directory if needed
  271. if test ! -d $mysql_datadir;        then mkdir $mysql_datadir; fi
  272. if test ! -d $mysql_datadir/mysql;    then mkdir $mysql_datadir/mysql; fi
  273. if test ! -d $mysql_datadir/test;    then mkdir $mysql_datadir/test; fi
  274.  
  275. # Make MySQL start/shutdown automatically when the machine does it.
  276. /sbin/chkconfig --add mysql
  277.  
  278. # Create a MySQL user. Do not report any problems if it already
  279. # exists. This is redhat specific and should be handled more portable
  280. useradd -M -r -d $mysql_datadir -s /bin/bash -c "MySQL server" mysql 2> /dev/null || true 
  281.  
  282. # Change permissions so that the user that will run the MySQL daemon
  283. # owns all database files.
  284. chown -R mysql $mysql_datadir
  285.  
  286. # Initiate databases
  287. mysql_install_db -IN-RPM
  288.  
  289. # Change permissions again to fix any new files.
  290. chown -R mysql $mysql_datadir
  291.  
  292. # Fix permissions for the permission database so that only the user
  293. # can read them.
  294. chmod -R og-rw $mysql_datadir/mysql
  295.  
  296. # Restart in the same way that mysqld will be started normally.
  297. /etc/rc.d/init.d/mysql start
  298.  
  299. # Allow safe_mysqld to start mysqld and print a message before we exit
  300. sleep 2
  301.  
  302. %post Max
  303. # Restart mysqld, to use the new binary.
  304. # There may be a better way to handle this.
  305. /etc/rc.d/init.d/mysql stop > /dev/null 2>&1
  306. echo "Giving mysqld a couple of seconds to restart"
  307. sleep 5
  308. /etc/rc.d/init.d/mysql start
  309. sleep 2
  310.  
  311. %preun
  312. if test $1 = 0
  313. then
  314.   if test -x /etc/rc.d/init.d/mysql
  315.   then
  316.     /etc/rc.d/init.d/mysql stop > /dev/null
  317.   fi
  318.  
  319.   # Remove autostart of mysql
  320.   /sbin/chkconfig --del mysql
  321. fi
  322. # We do not remove the mysql user since it may still own a lot of
  323. # database files.
  324.  
  325. %files
  326. %attr(-, root, root) %doc /usr/doc/MySQL-%{mysql_version}/
  327.  
  328. %attr(755, root, root) /usr/bin/isamchk
  329. %attr(755, root, root) /usr/bin/isamlog
  330. %attr(755, root, root) /usr/bin/pack_isam
  331. %attr(755, root, root) /usr/bin/myisamchk
  332. %attr(755, root, root) /usr/bin/myisamlog
  333. %attr(755, root, root) /usr/bin/myisampack
  334. %attr(755, root, root) /usr/bin/mysql_fix_privilege_tables
  335. %attr(755, root, root) /usr/bin/mysql_convert_table_format
  336. %attr(755, root, root) /usr/bin/mysql_install_db
  337. %attr(755, root, root) /usr/bin/mysql_setpermission
  338. %attr(755, root, root) /usr/bin/mysql_zap
  339. %attr(755, root, root) /usr/bin/mysqlbug
  340. %attr(755, root, root) /usr/bin/mysqltest
  341. %attr(755, root, root) /usr/bin/mysqlhotcopy
  342. %attr(755, root, root) /usr/bin/perror
  343. %attr(755, root, root) /usr/bin/replace
  344. %attr(755, root, root) /usr/bin/resolveip
  345. %attr(755, root, root) /usr/bin/safe_mysqld
  346. %attr(755, root, root) /usr/bin/mysqld_multi
  347. %attr(755, root, root) /usr/bin/my_print_defaults
  348.  
  349. %attr(644, root, root) /usr/info/mysql.info*
  350.  
  351. %attr(755, root, root) /usr/sbin/mysqld
  352.  
  353. %attr(644, root, root) /etc/logrotate.d/mysql
  354. %attr(755, root, root) /etc/rc.d/init.d/mysql
  355.  
  356. %attr(755, root, root) /usr/share/mysql/
  357.  
  358. %files client
  359. %attr(755, root, root) /usr/bin/msql2mysql
  360. %attr(755, root, root) /usr/bin/mysql
  361. %attr(755, root, root) /usr/bin/mysqlaccess
  362. %attr(755, root, root) /usr/bin/mysqladmin
  363. %attr(755, root, root) /usr/bin/mysql_find_rows
  364. %attr(755, root, root) /usr/bin/mysqldump
  365. %attr(755, root, root) /usr/bin/mysqlimport
  366. %attr(755, root, root) /usr/bin/mysqlshow
  367. %attr(755, root, root) /usr/bin/mysqlbinlog
  368.  
  369. %attr(644, root, man) %doc /usr/man/man1/mysql.1*
  370. %attr(644, root, man) %doc /usr/man/man1/isamchk.1*
  371. %attr(644, root, man) %doc /usr/man/man1/isamlog.1*
  372. %attr(644, root, man) %doc /usr/man/man1/mysql_zap.1*
  373. %attr(644, root, man) %doc /usr/man/man1/mysqlaccess.1*
  374. %attr(644, root, man) %doc /usr/man/man1/mysqladmin.1*
  375. %attr(644, root, man) %doc /usr/man/man1/mysqld.1*
  376. %attr(644, root, man) %doc /usr/man/man1/mysqld_multi.1*
  377. %attr(644, root, man) %doc /usr/man/man1/mysqldump.1*
  378. %attr(644, root, man) %doc /usr/man/man1/mysqlshow.1*
  379. %attr(644, root, man) %doc /usr/man/man1/perror.1*
  380. %attr(644, root, man) %doc /usr/man/man1/replace.1*
  381. %attr(644, root, man) %doc /usr/man/man1/safe_mysqld.1*
  382.  
  383. %post shared
  384. /sbin/ldconfig
  385.  
  386. %postun shared
  387. /sbin/ldconfig
  388.  
  389. %files devel
  390. %attr(755, root, root) /usr/bin/comp_err
  391. %attr(755, root, root) /usr/include/mysql/
  392. %attr(755, root, root) /usr/lib/mysql/
  393. %attr(755, root, root) /usr/bin/mysql_config
  394.  
  395. %files shared
  396. # Shared libraries (omit for architectures that don't support them)
  397. %attr(755, root, root) /usr/lib/*.so*
  398.  
  399. %files bench
  400. %attr(-, root, root) /usr/share/sql-bench
  401. %attr(-, root, root) /usr/share/mysql-test
  402.  
  403. %files Max
  404. %attr(755, root, root) /usr/sbin/mysqld-max
  405.  
  406. %changelog 
  407.  
  408. * Fri Apr 13 2001 Monty
  409.  
  410. - Added mysqld-max to the distribution
  411.  
  412. * Tue Jan 2  2001  Monty
  413.  
  414. - Added mysql-test to the bench package
  415.  
  416. * Fri Aug 18 2000 Tim Smith <tim@mysql.com>
  417.  
  418. - Added separate libmysql_r directory; now both a threaded
  419.   and non-threaded library is shipped.
  420.  
  421. * Wed Sep 28 1999 David Axmark <davida@mysql.com>
  422.  
  423. - Added the support-files/my-example.cnf to the docs directory.
  424.  
  425. - Removed devel dependency on base since it is about client
  426.   development.
  427.  
  428. * Wed Sep 8 1999 David Axmark <davida@mysql.com>
  429.  
  430. - Cleaned up some for 3.23.
  431.  
  432. * Thu Jul 1 1999 David Axmark <davida@mysql.com>
  433.  
  434. - Added support for shared libraries in a separate sub
  435.   package. Original fix by David Fox (dsfox@cogsci.ucsd.edu)
  436.  
  437. - The --enable-assembler switch is now automatically disables on
  438.   platforms there assembler code is unavailable. This should allow
  439.   building this RPM on non i386 systems.
  440.  
  441. * Mon Feb 22 1999 David Axmark <david@detron.se>
  442.  
  443. - Removed unportable cc switches from the spec file. The defaults can
  444.   now be overridden with environment variables. This feature is used
  445.   to compile the official RPM with optimal (but compiler version
  446.   specific) switches.
  447.  
  448. - Removed the repetitive description parts for the sub rpms. Maybe add
  449.   again if RPM gets a multiline macro capability.
  450.  
  451. - Added support for a pt_BR translation. Translation contributed by
  452.   Jorge Godoy <jorge@bestway.com.br>.
  453.  
  454. * Wed Nov 4 1998 David Axmark <david@detron.se>
  455.  
  456. - A lot of changes in all the rpm and install scripts. This may even
  457.   be a working RPM :-)
  458.  
  459. * Sun Aug 16 1998 David Axmark <david@detron.se>
  460.  
  461. - A developers changelog for MySQL is available in the source RPM. And
  462.   there is a history of major user visible changed in the Reference
  463.   Manual.  Only RPM specific changes will be documented here.
  464.